using System;

namespace PHSRAG.Insight21.InsightUtilities
{
	/// <summary>
	/// The class contains public properties and members to get constant values to be used
	/// throughout insight.
	/// </summary>
	public class Constants
	{	
		#region Constants
		private const string SortAscendingTextValue		= "5";
		private const string SortDescendingTextValue	= "6";
		private const string SortSymbolFontNameValue	= "Webdings";

		/// <summary> Help Text to display in search control next to the toggler </summary>
		public const string SearchHelpText				= @"To perform a wildcard search, 
			substitute the % sign for words or characters within your search criteria.";
        public const string FilterHelpText              = "<br/>&nbsp;&nbsp;&nbsp;&nbsp;Specify one or more search criteria to limit the results and click the \"search\" button";

		/// <summary>Used to when applying sort ascending to DataView. </summary>
		public const string SortViewAscending				= "ASC";
		/// <summary>Used to when applying sort descending to DataView. </summary>
		public const string SortViewDescending				= "DESC";

        public const string ProjectHeaderException          = "No project header information available.";

		public const string ZeroDollarsNoCents				= "$0";

		/// <summary>
		/// Database Key used to obtain a connection string to the ReX database.
		/// </summary>
		public const string RexDatabaseKey				   = "Rex";

		/// <summary>
		/// The cache key for the application-level dictionary that stores the mapping
		/// between RoleId, Insight role name, and Rex role name for Humans.
		/// </summary>
        public const string HumansRolesKey = "humansRolesKey_B639C074-B51A-422f-BE02-4E9A9CFB9958";

        /// <summary>
        /// The cache key for the application-level dictionary that stores the mapping
        /// between RoleId, Insight role name, and Rex role name for ANIMALS.
        /// </summary>
        public const string AnimalsRolesKey = "AnimalsRolesKey_1196762B-27DD-4c44-BBCC-C66ED991BDFE";

        /// <summary>Gets the cache key for the client-side script which may be used by the Calendar web control.</summary>
        /// <remarks>
        /// If a Javascript with this key is registered, the Calendar control will fire the function
        /// "ValidateDateRange()" in the "onblur" event of the Calendar's TextBox.
        /// </remarks>
        public const string ValidateDateRangeScriptKey  = "validateDateRangeScript_601AE4D7-2CBB-413c-82AF-789A94B00BBF";

		#region Search Criteria Keys
		/// <summary>ActivityCode search criteria key.</summary>
		public const string ActivityCodeKey			= "activitycode";
		//		/// <summary>ActivityTypeID search criteria key.</summary>
		//		public const string ActivityTypeIDKey			= "activitytype";
		/// <summary>AgreementStatusID search criteria key.</summary>
		public const string AgreementStatusIDKey		= "agreementstatus";
		/// <summary>AgreementTypeID search criteria key.</summary>
		public const string AgreementTypeIDKey			= "agreementtype";
		/// <summary>BalanceGreaterThan search criteria key. </summary>
		public const string BalanceGreaterThanKey		= "balancegreaterthan";
        /// <summary>Cumulative search criteria key. </summary>
        public const string CumulativeKey = "cumulative";
        /// <summary>DaysFundCreated search criteria key. </summary>
		public const string DaysFundCreatedKey			= "daysfundcreated";
		/// <summary>Details search criteria key. </summary>
		public const string DetailsKey			= "details";
		/// <summary>BalanceLessThan search criteria key. </summary>
		public const string BalanceLessThanKey			= "balancelessthan";
		/// <summary>BicsNumber search criteria key.</summary>
		public const string BicsNumberKey				= "bicsnumber";
		/// <summary>BudgetStartDate search criteria key.</summary>
		public const string BudgetStartDateKey			= "budgetstartdate";
		/// <summary>BudgetEndDate search criteria key.</summary>
		public const string BudgetEndDateKey			= "budgetenddate";
        /// <summary>BudgetStartDate search criteria key.</summary>
        public const string BudgetEndFromKey = "budgetEndFrom";
        /// <summary>BudgetEndDate search criteria key.</summary>
        public const string BudgetEndToKey = "budgetEndTo";
		/// <summary>TransactionStartDate search criteria key.</summary>
		public const string TransactionStartDateKey			= "transactionstartdate";
		/// <summary>TransactionEndDate search criteria key.</summary>
		public const string TransactionEndDateKey			= "transactionenddate";
		/// <summary>Cos search criteria key.</summary>
		public const string CosKey						= "cos";
		/// <summary>DaysBudgetEnding search criteria key. </summary>
		public const string DaysBudgetEndingKey			= "daysbudgetending";
		/// <summary>DaysProjectEnding search criteria key. </summary>
		public const string DaysProjectEndingKey		= "daysprojectending";
		/// <summary>DistributionEndDate search criteria key.</summary>
		public const string DistributionEndDateKey		= "distributionenddate";
		/// <summary>DistributionStartDate search criteria key.</summary>
		public const string DistributionStartDateKey	= "distributionstartdate";
		/// <summary>DomainUserID search criteria key.</summary>
		public const string DomainUserIDKey				= "domainuserid";
		/// <summary>FirstName search criteria key. </summary>
		public const string FirstNameKey				= "firstname";
		/// <summary>FundID search criteria key.</summary>
		public	const string FundIDKey					= "fundid";
		/// <summary>FolderNumber search criteria key.</summary>
		public const string FolderNumberKey				= "foldernumber";
		/// <summary>FundStatusID search criteria key.</summary>
		public const string FundStatusIDKey				= "fundstatus";
		/// <summary>GLPostAsOfDate search criteria key.</summary>
		public const string GLPostAsOfDateKey			= "glPostAsOfDate";
		/// <summary>IncludeProgramProjects search criteria key. </summary>
		public const string IncludeProgramProjectsKey	= "includeprogramprojects";
		/// <summary>LastName search criteria key. </summary>
		public const string LastNameKey					= "lastname";
		/// <summary>LocationID search criteria key.</summary>
		public const string LocationIDKey				= "location";
		/// <summary>PIID search criteria key.</summary>
		public const string PIIDKey						= "pi";
		/// <summary>ProjectEndDate search criteria key.</summary>
		public const string ProjectEndDateKey			= "projectenddate";
        /// <summary>ProjectTitle search criteria key.</summary>
        public const string ProjectTitle = "projectTitle";
		/// <summary>ProjectStartDate search criteria key.</summary>
		public const string ProjectStartDateKey			= "projectstartdate";
        //Tkt-9704
        /// <summary>ProjectEndFrom search criteria key.</summary>
        public const string ProjectEndFromKey = "projectEndFrom";
        /// <summary>projectEndToKey search criteria key.</summary>
        public const string ProjectEndToKey = "projectEndTo";
        //Tkt-9704 End
		/// <summary>SponsorID search criteria key.</summary>
		public const string SponsorIDKey				= "sponsorid";
		/// <summary>SponsorName search criteria key.</summary>
		public const string SponsorNameKey				= "sponsorname";
		/// <summary>SponsorNumber search criteria key.</summary>
		public const string SponsorNumberKey			= "sponsornumber";
		/// <summary>SponsorTypeID search criteria key.</summary>
		public const string SponsorTypeIDKey			= "sponsortype";
		/// <summary>StatusID search criteria key.</summary>
		public const string StatusIDKey					= "status";
		/// <summary>Viewing Option search criteria key.</summary>
		public	const string ViewingOptionKey			= "viewingoption";
		/// <summary>WalkerNumber search criteria key.</summary>
		public const string WalkerNumberKey				= "walkernumber";
		/// <summary>CategoryID search criteria key.</summary>
		public const string CategoryIDKey				= "categoryID";
		/// <summary>AccountID search criteria key.</summary>
		public const string AccountIDKey				= "accountID";
		/// <summary>AccountNumber search criteria key.</summary>
		public const string AccountNumberKey			= "accountNumber";
		/// <summary>IncludeUserOrders search criteria key.</summary>
		public const string IncludeUserOrdersKey		= "includeUserOrders";

		/// <summary>Employeeid search criteria key.</summary>
		public const string EmployeeIdKey		= "employeeid";

		/// <summary>Pay from date search criteria key.</summary>
		public const string PayFromDateKey		= "payfromdate";

		/// <summary>paytodate search criteria key.</summary>
		public const string PayToDateKey		= "paytodate";

        public const string PaySalaryDateFromKey = "paysalarydatefrom";
        public const string PaySalaryDateToKey = "paysalarydateto";

		/// <summary>Salary on fund expiring in search criteria key.</summary>
		public const string SalaryOnFundExpiringKey		= "salaryonfundexpiring";

		/// <summary>Expense from date search criteria key.</summary>
		public const string ExpenseFromDateKey			= "expensefromdate";
		/// <summary>Expense to date search criteria key.</summary>
		public const string ExpenseToDateKey			= "expensetodate";
        public const string RevenueFromDateKey = "revenuefromdate";
        public const string RevenueToDateKey = "revenuetodate";
        public const string RevenueAccountNumber = "revenueaccountnumber";
		/// <summary>All expenses search criteria key.</summary>
		public const string AllExpensesKey			= "allexpenses";
		/// <summary>FundNumber key.</summary>
		public const string FundNumberKey			= "fundnumber";

        #region LaborDistributionSearch constants
        public const string JobCodeKey = "jobCode";
        public const string RetroSalaryDateFromKey = "retroSalaryDateFrom";
        public const string RetroSalaryDateToKey = "retroSalaryDateTo";
        public const string PayFrequencyTypeKey = "payFrequencyType";
        public const string FundStatusKey = "status";
        #endregion

        #region PatientCareDetailsSearch constants
        public const string PatientMRNKey = "patientMRN";
        public const string ChargeCodeKey = "chargeCode";
        public const string InstitutionalMRNKey = "institutionalMRN";
        public const string PostFromDateKey = "postFromDate";
        public const string PostToDateKey = "postToDate";
        public const string ServiceFromDateKey = "serviceFromDate";
        public const string ServiceToDateKey = "serviceToDate";

        /// <summary>In PS it is a DocumentLetter</summary>
        public const string DocumentId = "documentId";

        #endregion

		/// <summary>Page Name Key </summary>
		public const string PageNameKey			= "pagename";

        /// <summary>ProjectTitle search criteria key.</summary>
        public const string ViewType = "viewType";
		#endregion

        #region Common Search Constants
        public const string SearchButtonClientIDKey     = "searchButtonClientIDKey_C6704559-C591-4610-BBF6-31A4422FA7F3";
        #endregion

        #region Institution Constants
        public class Institution
        {
            public const string MGH = "MGH";
            public const string BWH = "BWH";
        }
        #endregion

        #region
        public class PersonnelConstants
		{
			public const string	EmployeeJobMapIDKey		= "employeeJobMapId";
			public const string	EndDateKey				= "enddate";
		}
		
		#endregion

		#region Constants
		public class Annunciator
		{
			public const string Title = "The following error(s) occurred...";
		}
		#endregion

		#region Agreements Constants
		public class AgreementsConstants
		{
			#region TableNames agreements, budget
			// table names for projections and budget
			public const string CategoryTableName				= "Category";
			public const string DisplayCategoriesTableName		= "Categories";
			public const string AccountsTableName				= "Accounts";
			public const string DistinctAccountsTableName		= "DistinctAccounts";
			public const string DirectCostsTableName			= "DirectCosts";
			public const string IndirectCostsTableName			= "IndirectCosts";
			public const string TotalCostsTableName				= "TotalCosts";
            public const string RevenueTableName                = "Revenue";
			public const string PriorYrBalanceTableName			= "PriorYearBalance";
			public const string CashBalanceTableName			= "CashBalance";		
			public const string ProjectHeader					= "ProjectHeader";
            public const string MonthsRemainingTableName        = "MonthsRemainingInBudget";

			#endregion

			#region TableNames Contract Details
			//table names for contract details
			public const string SubContractsTableName			= "SubContracts";
			public const string AssociatedAgreementsTableName	= "AssociatedAgreements";
			public const string TermsAndConditionsTableName		= "TermsAndConditions";
			public const string RelatedProtocolsTableName		= "RelatedProtocols";
			public const string MileStonesTableName				= "MileStones";
			public const string FundInfoTableName				= "FundInfo";
			#endregion TableNames Contract Details
		
		#region cache keys
		public const string AccessRightsKey = "accessRightsKey_77DFDA79-3446-447f-905A-F57EA38BE797";
		public const string AgreementDetailsKey = "agreementDetailsKey_06AB2FD7-D783-4d8e-AC5E-2119C71AF9A4";
		public const string	IsDetailsKey		= "detailsKey_06AB2FD7-D783-4d8e-AC5E-2119C71AF9A4";

		#endregion
		}
		#endregion

		#region Budget Overview and Details Constants
		public class BudgetInfoConstants
		{
			public const string CategoryTableName			= "CategoryTable";
			public const string CategoryIDColumnName		= "CategoryID";
			public const string AccountIDColumnName			= "AccountID";
            public const string AccountNumberColumnName = "AccountNumber";
			public const string CategoryColumnName			= "Category";
			public const string BudgetColumnName			= "Budget";
			public const string ExpenseColumnName			= "Expense";
			public const string EncumbranceColumnName		= "Encumbrance";
			public const string BalanceAvailableColumnName	= "BalanceAvailable";
			public const string UserOrderCategoryTableName	= "UserOrder";
		}
		#endregion

        #region HumansSearch
        /// <summary>
		/// Provides access to cache keys used for the various search criteria in the humans module
		/// </summary>
		public class PrimaryProtocolSearch
		{
			/// <summary>ProtocolNumber search criteria key. </summary>
			public const string ProtocolNumberKey		= "protocolnumber";
			/// <summary>ProtocolTitle search criteria key. </summary>
			public const string ProtocolTitleKey		= "protocoltitle";
			/// <summary>ProtocolSponsorName search criteria key. </summary>
			         
		}
        /// <summary>Provides access to cache keys used for the advanced search criteria(Humans/animals) </summary>
        public class AdvancedProtocolSearch
        {
            public const string ProtocolSponsorKey = "protocolsponsor";
            /// <summary>ProtocolSponsorName search criteria key. </summary>
            public const string VersionKey = "version";
            /// <summary>ProtocolExpirationStartDate search criteria key. </summary>
            public const string ProtocolExpStartDateKey = "expirationdatefrom";
            /// <summary>ProtocolExpirationEndDate search criteria key. </summary>
            public const string ProtocolExpEndDateKey = "expirationdateto";
            /// <summary>ProtocolPIKey search criteria key. </summary>
            public const string ProtocolPIKey = "pi";
            /// <summary>ProtocolCOSKey search criteria key. </summary>
            public const string ProtocolCOSKey = "cos";  
            /// <summary>Species search criteria key</summary>
            public const string SpeciesKey = "speciesName";
            /// <summary>RadioIsotopKey key</summary>
            public const string RadioIsotopeKey = "radioIsotope";
            /// <summary>Biological agent key</summary>
            public const string BiologicalAgentKey = "biologicalAgent";
            /// <summary>Toxic Chemicals key</summary>
            public const string ToxicChemicalsKey = "toxicChemicals";
            /// <summary>Tissue test key</summary>
            public const string TissueTestKey = "tissueTest";
        }
        #endregion

		/// <summary>
		/// Provides constants used in the Humans module
		/// </summary>
		public class Humans
		{
			/// <summary>Address to the Notification Page</summary>
			public const string IRBNotificationPage = "../Humans/Notification.aspx";
		}

		public class Modules
		{
			/// <summary>The Admin Module Name. </summary>
			public const string Admin			= "Admin";
			/// <summary>The Agreements Module Name. </summary>
			public const string Agreements		= "Agreements";
			/// <summary>The Home Module Name. </summary>
			public const string Home			= "Home";
			/// <summary>The Humans Module Name. </summary>
			public const string Humans			= "Humans";
			/// <summary>The Personnel Module Name. </summary>
			public const string Personnel		= "Personnel";
			/// <summary>The Purchasing Module Name. </summary>
			public const string Purchasing		= "Purchasing";
			/// <summary>The Clinical Trials Module Name. </summary>
			public const string ClinicalTrials	= "Clinical Trials";
			/// <summary>Conflict of Interest Module Name. </summary>
			public const string COI = "Conflict of Interest";
			/// <summary>Reporting Module Name. </summary>
			public const string Reporting = "Reports";
            /// <summary>Animals Module Name. </summary>
            public const string Animals = "Animals";
            /// <summary>  eIRB Module Name </summary>
           
            public const string eIRB = "eIRB";
		}

		public class ModulePages
		{
			#region	Agreements
			public const string AgreementSummary	= "AgreementSummary.aspx";
			public const string FinancialSummary	= "FinancialSummary.aspx";
			public const string TransactionOverview = "TransactionOverview.aspx";
			public const string TransactionDetails	= "TransactionDetails.aspx";
			public const string SalaryOverview		= "SalaryOverview.aspx";
			
			#endregion

			#region	Purchasing Pages
			public const string POAPSummaryHeader	= "POAPSummaryHeader.aspx";
			public const string PODetails			= "PODetails.aspx";
			public const string JournalEntryDetails	= "FinancialTransaction.aspx";

			#endregion
		}

		#region Report Download

		#region Host Pages
		/// <summary>Link to ReportHost.aspx for popup functionality.</summary>
		public const string ReportHostPage = "../Common/DownloadBarHelper/ReportHost.aspx";
		/// <summary>Link to ExcelHost.aspx for popup functionality.</summary>
		public const string ExcelHostPage = "../Common/DownloadBarHelper/ExcelHost.aspx";
		/// <summary>Link to EmailHost.aspx for popup functionality.</summary>
		public const string EmailHostPage = "../Common/DownloadBarHelper/EmailHost.aspx";
      /// <summary>The user is reqired to perform a search prior to downloading a report</summary>
      public const string SearchRequired = "Searching is required prior to performing a download.";
		#endregion

		#region Template Parameter Names
		/// <summary>Report title(usually page name). </summary>
		public const string ReportTitle = "reportTitle";
		/// <summary>User name of the person logged in to the system. </summary>
		public const string LoggedInUsername = "loggedInUser";
		/// <summary>Filter criteria used to generate the report. </summary>
		public const string FilterCriteria = "filterCriterias";
		/// <summary> Total number of records being downloaded. </summary>
		public const string RecordCount = "recordCount";
		/// <summary> Full name of the logged in user (LastName, FirstName) </summary>
		public const string LoggedInUserFullName = "loggedInUserFullName";
		/// <summary> Insight Url </summary>
		public const string InsightUrl = "InsightUrl";
		#endregion
		#endregion

		#region	Purchasing Search Keys
		/// <summary>
		/// Provides access to cache keys used for the various search criteria in the Purchasing module
		/// </summary>
		public class PurchasingSearchKey
		{
			public const string PONumberKey				= "ponumber";
			public const string VendorNameKey			= "vendorname";
			public const string FundNumberKey			= "fundnumber";
			public const string AccountNumberKey		= "accountnumber";
			public const string CategoryIdKey			= "category";
			public const string InvoiceNumberKey		= "invoicenumber";
			public const string VoucherNumberKey		= "vouchernumber";
			public const string JournalNumberKey		= "journalnumber";
			public const string RequestorNameKey		= "requestorname";
			public const string RequisitionNumberKey	= "requisitionnumber";
			public const string TransactionTypeKey		= "transactiontype";
			public const string TransactionDateFromKey	= "transactiondatefrom";
			public const string TransactionDateToKey	= "transactiondateto";

			public const string EnteredByKey			= "enteredby";
			public const string OrderTypeKey			= "ordertype";

			public const string SelectOrderViewKey		= "selectorderview";
			public const string ExpenseStatusViewKey	= "expensestatusview";
			public const string UserOrderTypeViewKey	= "userordertypeview";
 
			public const string TotalOrderAmountKey		= "totalorderamount";
			public const string InvoiceDateKey			= "invoicedate";
			public const string DaysTransactionsWithinKey	= "transactionswithin";
			public const string ReconcileTypeKey			= "reconciletype";
		}

		#endregion

		#endregion

		#region Private Constructor
		/// <summary>
		/// Private constructor to ensure no instances of this class are created.
		/// </summary>
		private Constants(){}
		#endregion

		#region Public Properties

		#region DataGrid Sort
		/// <summary>
		/// Gets the text value that shows ascending sort option.
		/// </summary>
		public static string SortAscendingText
		{
			get { return SortAscendingTextValue; } 
		}

		/// <summary>
		/// Gets the text value that shows descending sort option.
		/// </summary>
		public static string SortDescendingText
		{
			get { return SortDescendingTextValue; }
		}

		/// <summary>
		/// Gets the font name value for datagrid sort symbol.
		/// </summary>
		public static string SortSymbolFontName
		{
			get { return SortSymbolFontNameValue; }
		}
		#endregion
		
		#endregion

        #region Feed Type to fetch the Last feed run date
        public class FeedType
        {
            public const string Cachekey = "LastfeedRunDateKey_81114208-E760-49b1-A730-426C1DA59CA5";
            public const string HumansFeed = "NewProtocol_RexToAsset";
        }
        #endregion
    }   

    /// <summary>
	/// Flags to be used to instruct business objects whether to retrieve just
	/// IDs or a full dataset.
	/// </summary>
	public enum ResultSetType
	{
		IDsOnly,
		Full
	}
}
